<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Untitled Document</title>
	</head>
	<body>
		aaaaaaaaaaaaaaaaaa<div>bbb</div><img src="img/loading100.gif">
		<script type="text/javascript">
		if (document.body.addEventListener) {
			document.body.addEventListener('contextmenu', function(e){
				get();
			}, false);
		} else {
			document.body.attachEvent('oncontextmenu', function(e){
				get();
			});
		}
			
		var get = function(){
			if (window.getSelection) {
				var sel = window.getSelection();
	
				// console.log('test.js : atpaDOM -> get Selected HTML (0)' + sel);
				
				var r;
				if (sel.getRangeAt) {
					r = sel.getRangeAt(0);
				}
				else { /* for Safari 1.3 */
					r = document.createRange();
					r.setStart(sel.anchorNode, sel.anchorOffset);
					r.setEnd(sel.focusNode, sel.focusOffset);
				}
				var cc = r.cloneContents();
				alert(r.cloneContents());
//				e.appendChild(r.cloneContents());
				
//				document.getElementsByTagName('body')[0].removeChild(obj);
				
//				var ret = e.innerHTML;
				
//				e.innerHTML = '';
				return ret;
			} else if (document.selection) {
				var r = document.selection.createRange();
				alert(r);
			}
			else 
				return '';
		}
		</script>
	</body>
</html>
